<?php
error_reporting(E_ALL);

date_default_timezone_set('Europe/London');

//phpexcel
require_once 'PHPExcel/Classes/PHPExcel.php';


$objPHPExcel = new PHPExcel();

$objPHPExcel->getProperties()->setCreator("Maarten Balliauw")
             ->setLastModifiedBy("Maarten Balliauw")
             ->setTitle("Office 2007 XLSX Test Document")
             ->setSubject("Office 2007 XLSX Test Document")
             ->setDescription("Test document for Office 2007 XLSX, generated using PHP classes.")
             ->setKeywords("office 2007 openxml php")
             ->setCategory("Test result file");

$objPHPExcel->setActiveSheetIndex(0)
            ->setCellValue('a1','Hello')
            ->setCellValue('b1','World');

$objPHPExcel->getActiveSheet()->setTitle('hi');

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel,'excel2007');

$objWriter->save(str_replace('.php', '.xlsx', __FILE__));